<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="/public/static/h-ui/css/style.css?v=1.3" />
    <link media="all" href="/public/menu/css/article.css" type="text/css" rel="stylesheet">
    <style>
        td a:hover {background-color: rgb(13, 163, 249);color:#fff;border:1px solid rgb(13, 163, 249);}
    </style>
</head>
<body style="background-color: rgb(255, 255, 255);">
<div class="jbox-container" style="float: left; padding: 0px;">
    <ul  class="gagp-goodslist" style="padding: 10px; width: 750px;">
        <!-- 栏目分类 -->
        <table class="wxtables">
            {if $type == 'bargain_info' || $type == 'pintuan_info' || $type == 'miaosha'}
            <colgroup>
                <col><col><col width="30%"><col><col><col><col>
            </colgroup>
            {/if}
            <thead>
            <tr style="background-color: rgb(13, 163, 249);">
                <td>ID</td>
                {if $type != 'applets' && $type != 'web_page' && $type != 'my_order'}
                <td>缩略图</td>
                {/if}
                <td>名称</td>
                {if $type == 'miaosha'}
                <td>秒杀价</td>
                <td>库存</td>
                <td>活动时间</td>
                {/if}
                {if $type == 'applets'}
                <td>AppID</td>
                {/if}
                {if $type == 'web_page'}
                <td>url</td>
                {/if}
                {if $type == 'bargain_info' || $type == 'pintuan_info'}
                <td>原价</td>
                {/if}
                {if $type == 'bargain_info'}
                <td>最低价格</td>
                {/if}
                {if $type == 'pintuan_info'}
                <td>团购价</td>
                {/if}
                {if $type != 'my_order' && $type!='miaosha'}
                <td>发布时间</td>
                {/if}
                <td style="text-align: center;">操作</td>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="vo"}
            <tr>
                <td><p>{$vo['id']}</p></td>
                {if $type != 'applets' && $type != 'web_page' && $type != 'my_order'}
                <td>
                    <p>
                    {if $vo['img'] == 'none'}
                    <img src="/public/goods/img/default_goods_image_240.gif" alt="" height="50px" width="50px">
                    {else}
                    <img src="{$vo['img']}" alt="" height="50px" width="50px">
                    {/if}
                    </p>
                </td>
                {/if}
                <td><p>{$vo['name']|subtext=30}</p></td>
                {if $type == 'miaosha'}
                <td>￥ {$vo['price']}</td>
                <td>{$vo['all_sell']}</td>
                <td>{$vo['stime']|date='Y-m-d H:i:s',###}<br>{$vo['etime']|date='Y-m-d H:i:s',###}</td>
                {/if}
                {if $type == 'applets'}
                <td>{$vo['appid']}</td>
                {/if}
                {if $type == 'web_page'}
                <td>{$vo['url']}</td>
                {/if}
                {if $type == 'bargain_info' || $type == 'pintuan_info'}
                <td>{$vo['price']}</td>
                {/if}
                {if $type == 'bargain_info'}
                <td>{$vo['lowest_price']}</td>
                {/if}
                {if $type == 'pintuan_info'}
                <td>{$vo['gprice']}</td>
                {/if}
                {if $type != 'my_order' && $type!='miaosha'}
                <td><p>{$vo['create_time']|date='Y-m-d H:i:s',###}</p></td>
                {/if}
                <td style="text-align: center;">
                    <a class="btn selecta"
                       data-path="{$vo.path}"
                       data-url="{$vo.url}"
                       data-appid="{$vo.appid}"
                       data-money="{$vo['price']}"
                       data-img_path="{$vo['img']}"
                       data-short_title="{$vo['introduction']}"
                       data-value="{$vo.id}"
                       data-type="{$type}"
                       data-oprice="{$vo.oprice}"
                       data-name="{$vo.name}">选择</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="n_page_no">
            {$page}
        </div>
    </ul>
</div>
<div style="height:80px; line-height: 80px;color:#fff; clear: both;">壹佰小程序占位</div>
<div class="sel_fun_opt" style="position: fixed; bottom: 0px;background: #fff;height: 60px;width:100%;border-top:1px solid #eeeeee;padding-top:20px;">
    <div class="sure" onclick="">确定</div>
    <div class="cancel" onclick="">返回</div>
</div>
<script type="text/javascript" src="/public/js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="/public/static/layer/2.4/layer.js"></script>
<script type="text/javascript">
    $(".selecta").click(function(){
        if ($(this).hasClass('selectedb')) {
        }else{
            $(this).addClass('selectedb');
            $(this).html('已选择');
            $(this).parent().parent().siblings().find('.selecta').removeClass('selectedb');
            $(this).parent().parent().siblings().find('.selecta').html('选择');
        }
    });
    $(".sure").click(function(){
        if (typeof($('.selectedb').attr('data-name'))=="undefined"){
            layer.msg('请选择内容',{icon:5,time:1000});
            return false;
        }
        var item = {};
        item['name'] = $('.selectedb').attr('data-name');
        item['type'] = $('.selectedb').attr('data-type');
        item['appid'] = $('.selectedb').attr('data-appid');
        item['url'] = $('.selectedb').attr('data-url');
        item['imgurl'] = $('.selectedb').attr('data-img_path');
        item['price'] = $('.selectedb').attr('data-money');
        item['description'] = $('.selectedb').attr('data-short_title');
        item['key'] = '{$type_key}';
        item['param'] = $('.selectedb').attr('data-value');
        item['path'] = $('.selectedb').attr('data-path');
        item['oprice'] = $('.selectedb').attr('data-oprice');
        var path = '{$path}';
        var id = $('.selectedb').attr('data-value');
        //3 跳转网页
        if(item['key'] != '3')
        {
            var url = path+"?id="+id;
            item['url'] = url;
        }
        else
        {
            item['url'] = encodeURIComponent(item['url']);
            var url = path+"?id="+id+"&name="+item['name']+"&url="+item['url'];
            item['url'] = url;
        }
        for(var k in item)
        {
            if(typeof (item[k])=="undefined" || item[k].length == 0){delete(item[k]);}
        }
        console.log(item);
        parent.menu_select(item);
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })
    $(".cancel").click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    });
</script>
</body>
</html>
